<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><{t}>购物订单打印<{/t}></title>

</head>

<style type="text/css" media="print">
.noprint{ display : none }
</style>

<style type="text/css" media="screen,print">
.x-barcode{padding:0;margin:0}
body { margin:0; font-family:Arial, Helvetica, sans-serif; font-size:12px;}
.td_frame { padding:5px 0 5px 0; border-bottom:2px solid #000000; }
img { padding:2px; border:0;}
p { margin:8px 0 8px 0;}
h1 { font-size:16px; font-weight:bold; margin:0;}
h2 { font-size:14px; font-weight:bold; margin:0;}
.table_data_title { font-size:14px; font-weight:bold; height:25px; }
.table_data_content { height:20px; line-height:20px;}
#print_confirm { width:100%;  height:30px;  border-top:1px solid #999999; padding-top:4px;   background-color:#5473ae; position:absolute; }
#btn_print { width:71px; height:24px; background-image:url(images/btn_print.gif); cursor:pointer; margin-left:auto; margin-right:auto;}
#barcode { width:150px; height:50px; background:url(images/bar_code.gif) no-repeat;}
</style>

 <{if defined('DEBUG_JS') && DEBUG_JS}>
	<script>DEBUG_JS=true;</script>
        <!--src tools-->
        <script type="text/javascript" src="js_src/moo.js"></script>
        <script type="text/javascript" src="js_src/moomore.js"></script>
        <script type="text/javascript" src="js_src/mooadapter.js"></script>
        <script type="text/javascript" src="js_src/jstools.js"></script>                
        <!--src component-->
        <script type="text/javascript" src="js_src/coms/colorpicker.js"></script>
        <script type="text/javascript" src="js_src/coms/areaselect.js"></script>
<{elseif defined('GZIP_JS') && GZIP_JS }>
    <script type="text/javascript" src="js/package/tools.jgz"></script>
    <script type="text/javascript" src="js/package/component.jgz"></script>
<{else}>
    <script type="text/javascript" src="js/package/tools.js"></script>
    <script type="text/javascript" src="js/package/component.js"></script>
<{/if}>
<script type="text/javascript">

Element.implement({
 zoomImg:function(maxwidth,maxheight,v){
	   if(this.getTag()!='img')return;
       var thisSize={'width':this.width,'height':this.height};
		   if (thisSize.width>maxwidth){
		      var overSize=thisSize.width-maxwidth;
			  var zoomSizeW=thisSize.width-overSize;
			  var zommC=(zoomSizeW/thisSize.width).toFloat();
			  var zoomSizeH=(thisSize.height*zommC).toInt();
			  $extend(thisSize,{'width':zoomSizeW,'height':zoomSizeH});
		   }
		   if (thisSize.height>maxheight){
		      var overSize=thisSize.height-maxheight;
			  var zoomSizeH=thisSize.height-overSize;
			  var zommC=(zoomSizeH/thisSize.height).toFloat();
			  var zoomSizeW=(thisSize.width*zommC).toInt();
			  $extend(thisSize,{'width':zoomSizeW,'height':zoomSizeH});
		   }
	   if(!v)return this.set(thisSize);
	   return thisSize;
	 }
  });
window.addEvents({
	"domready":function() {
		if($("chk_pic_print")){
			if(window.ie){
			  $("chk_pic_print").addEvent('click',function(){this.fireEvent('change');});
              $("chk_pic_print").addEvent('focus',function(){this.blur();})
			}
			$("chk_pic_print").addEvent("change",function(e){
				$$("#print1 img").setStyle("display",(this.checked == false?"none":'inline'));
			});
		}
		if ($("chk_pic_print1")){
			if(window.ie){
			  $("chk_pic_print1").addEvent('click',function(){this.fireEvent('change');});
              $("chk_pic_print1").addEvent('focus',function(){this.blur();})
			  $("chk_address").addEvent('click',function(){this.fireEvent('change');});
              $("chk_address").addEvent('focus',function(){this.blur();})			  
			}
			$("chk_pic_print1").addEvent("change",function(){
				$$("#print2 img").filter(function(e){return e.className!='x-barcode'}).setStyle("display",(this.checked == false?"none":'inline'));
			   $("print_confirm").setStyle("top",document.documentElement.scrollTop + window.getHeight() - 35);
			});
			$("chk_address").addEvent("change",function(){
				$("print_address").setStyle("display",(this.checked == false?"none":'inline'));
			});
		}
		$("print_confirm").setStyle("top",window.getHeight() - 35);
	
		$("btn_print").addEvent("click",function(){window.print()});
	},
	"scroll":function() {  
		$("print_confirm").setStyle("top",window.getSize().y+window.getScrollTop() - 35);},
	"resize":function() {
		$("print_confirm").setStyle("top",window.getSize().y+window.getScrollTop() - 35);
	}
});
window.addEvent('load',function(){
     $$("img.product").each(function(img){
         var _imgsrc=img.src;
         new Asset.image(_imgsrc,{
          onload:function(){
                img.set(this.zoomImg(60,60,1)).set('align','absmiddle');
         }});
     });
});



</script>

<body>

<div id="print1">
<{if $printContent.cart}>
<{$print_cart_content}>
<{/if}>
</div>
<div id="print2">
<{if $printContent.sheet}>
<{$print_sheet_content}>
<{/if}>
</div>
<div id="print_confirm" class="noprint"><div id="btn_print"></div></div>
</body>
</html>
